import React, { Children, Component } from 'react'
interface Iprops {
    show: boolean
}
export default class App extends Component<any, Iprops> {
    state = {
        show: false
    }
  render() {
    return (
      <div>
        <div>
            <button onClick={()=>{
                this.setState({
                    show: true
                })
            }}>change text</button>
        </div>
        <div>
            <ChildComponet show={this.state.show}></ChildComponet>
        </div>
      </div>
    )
  }
}
class ChildComponet extends Component<Iprops, any>{
  render() {
    return (
        <div>
            {this.props.show ? '01-抽屉' : '02-桌子'}
        </div>
    )
  }
}

